#ifndef __GL__COMMON__H__
#define __GL__COMMON__H__

#include "RendererCommon.h"
#include <assert.h>

#ifdef __ANDROID__
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2platform.h>
#endif

namespace simple_renderer {

#define GLES_STRINGIZE(x)   #x

typedef struct GLES_Matrix
{
    GLfloat m[16];
} GLES_Matrix;

const GLfloat *GLES2_getColorMatrix_bt709();
const GLfloat *GLES2_getColorMatrix_bt601();

const char *GLES2_getVertexShader_default();
const char *GLES2_getFragmentShader_yuv420p();

void GLES2_checkError(const char* op);
void GLES2_printString(const char *name, GLenum s);
void GLES2_printShaderInfo(GLuint shader);
void GLES2_printProgramInfo(GLuint program);
GLuint GLES2_loadShader(GLenum shader_type, const char *shader_source);

}

#endif